/*
  File:    Gradients.h
  Purpose: Adaptive routines to calculate gradients  

  Contact: Paul Macklin
           pmacklin@math.uci.edu
		  http://math.uci.edu/~pmacklin
*/

#include "../ImprovedMath.h"
#include "../Matrix.h"

/*
  Use the easy gradient version if differencing across the interface doesn't matter.
*/

bool CalculateGradients( Matrix& Input, Matrix* pGradX, Matrix* pGradY );
bool CalculateEasyGradients( Matrix& Input, Matrix* pGradX, Matrix* pGradY );

/* 
    Use this version if you need to use another level set function, e.g., PhiN
*/

bool CalculateGradients( Matrix& LevelSet, Matrix& Input, Matrix* pGradX, Matrix* pGradY );

/*
  Use this routine to extrapolate an interior function to the nearest outer 
  points. This is sometimes necessary if there are rapid changes in the 
  diffusion constant near the boundary. 
*/

bool ExtrapolateInteriorSpeed( Matrix& LevelSet, Matrix* Input );
